﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ModelQuality.Metrics.Model;

namespace ModelQuality.Metrics.Engine
{
    public class ValidationResult
    {
        /// <summary>
        /// NOTE: can be null in certain cases of global rule
        /// </summary>
        public EAObject ValidatedObject { get; private set; }

        public ValidationStatus Status { get; private set; }

        public ValidationMessage Message { get; private set; }

        public ValidationResult(EAObject validatedObject, ValidationStatus status)
        {
            this.ValidatedObject = validatedObject;
            this.Status = status;
        }

        public ValidationResult(EAObject validatedObject, ValidationStatus status, String messageCode, params Object[] messageParams) 
            : this(validatedObject, status)
        {
            this.Message = new ValidationMessage(messageCode, messageParams);
        }
    }

    public enum ValidationStatus
    {
        OK, KO
    }
}
